from flask import Flask
from flask import render_template

app = Flask(__name__)

from app.lodger1 import bp as bp1
from app.lodger2 import bp as bp2

lodgers = [
	["Pickle Lodger",		bp1, "/lodger1"],
	["SQLite Lodger",		bp2, "/lodger2"],
]


for fio, bp, url in lodgers:
	app.register_blueprint(bp, url_prefix=url)

@app.route("/")
def index():
	r = ""
	for fio, bp, url in lodgers:
		r += f'<a href="{url}">{fio}</a><br>'
	return render_template("index.tpl", lodgers=r)
